RegularExp
Section: ET++ class description (n)
Updated: automatically Mon Apr 8 20:18:26 1991
Index
Return to Main Contents
NAME
RegularExp.short - GNU emacs regular expressions
DESCRIPTION
The class RegularExp implements regular expressions in the style of the GNU emacs editor. Additional information about GNU emacs regular expressions is contained in the file $ET_DIR/doc/regex.txt.
Regular expressions are used to check whether a string matches or contains a certain pattern. For example, the pattern [0-9]* matches all strings that consist of any number of digits including zero.
RegularExp provides two ways of comparing:
It can be tested whether a string exactly matches the regular expression or whether the pattern is contained somewhere in the string. The second way allows to find any occurrence of the pattern by searching forward or backward in the string.
The "Find/Change" dialog of a TextView allows to enter a regular expression in the "Find:" field. Regular expressions are also used by the class RestrTextView and the class RestrTextItem.
Examples for valid regular expressions:
float: "+\|-)?[0-9]*\.[0-9]*)?"
int: "+\|-)?[0-9]*"
double: "+\|-)?[0-9]*\.[0-9]*)?[eE]+\|-)?[0-9]*)?"
alpha: "[A-Za-z]+"
lowercase: "[a-z]+"
uppercase: "[A-Z]+"
alphanum: "[0-9A-Za-z]+"
identifier: "[A-Za-z_][A-Za-z0-9_]*"
classes are never derived from RegularExp.
class RegularExp
is sometimes reused directly.
class RegularExp contains 15 methods.
- owner of class:
-
nobody.
- baseclasses:
-
Object
- flags:
-
ObjFlags
INSTANCE VARIABLES
- caseSensitive (private bool)
-
controls whether case is significant in searching
- fastSearch (private bool)
-
controls whether the fast map must be compiled for the regular expression
- pb (private re_pattern_buffer *)
-
a structured representation of the source pattern
- result (private char *)
-
the result of compiling the source pattern. It is NULL if the compilation was successful, otherwise it refers to an error message. result can be accessed with the method GetExprState.
- source (private char *)
-
the source pattern as specified in the constructor or in the method Reset. It is accessible with the method GetPattern.
INSTANCE METHOD LIST
- client interface
-
GetExprState
GetPattern
Match
MatchWordPattern
RegularExp
Reset
SearchBackward
SearchForward
- implementation
-
InspectorId
Match2
PrintOn
ReadFrom
SearchBackward2
SearchForward2
~RegularExp
CATEGORIES
Text Support
FILES
- declaration:
-
RegularExp.h
HISTORY
joe@csesbg.at Thu Sep 05 16:55 1991 MET DST
Index
- NAME
-
- DESCRIPTION
-
- INSTANCE VARIABLES
-
- INSTANCE METHOD LIST
-
- CATEGORIES
-
- FILES
-
- HISTORY
-
This document was created by
man2html,
using the manual pages.
Time: 00:40:24 GMT, March 30, 2022